<%@page contentType="text/html; charset=utf-8"%>
<%@ include file="/commons/taglibs.jsp"%>
<%@ include file="/commons/commonEdit.jsp"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title></title>
<script language="JavaScript" src="${ctx}/scripts/common/prototype.js"></script>
<script language="JavaScript" type="text/javascript" src="${ctx}/scripts/ajaxException.js"></script>
<script type="text/javascript" src="${ctx}/scripts/common.js"></script>
<script type="text/javascript">
	var index = null;
	var perferItemId = null;
   function openRectificateAdd(){
   		var url = "${ctx}/occupation_joinHandleAction.do?method=initRectificateAdd&id=${inspecteRequisteId}&identityValidateId=${identityValidateId}";
		top.windowOpen(url, 'RectificateAdd', '${key.add}', 360, 470, true, "RectificateAdd");
   }
   function openRectificateEdit(){
        if( index == null ){
			 ErrorAlert("${key.tipsByModify}");
			return false;
		}else{
		     var url = "${ctx}/occupation_joinHandleAction.do?method=checkPerfectItemRequiste&optType=edit&id="+perferItemId;
			 new Ajax.Request(url,{method: 'post' ,onSuccess : function(response){
			    ajaxSubmitException(response.responseText);
			    if("true" == response.responseText){
					var url = "${ctx}/occupation_joinHandleAction.do?method=initRectificateEdit&index="+index;
				    top.windowOpen(url, 'RectificateEdit', '${key.modify}', 360, 470, true, "RectificateEdit");
			    }
			}});

		}
   }
   function showRectificate(){
   		if( index == null ){
			ErrorAlert('${key.tipsByDelete}');
		}else{
		    var url = "${ctx}/occupation_joinHandleAction.do?method=checkPerfectItemRequiste&optType=delete&id="+perferItemId;
			new Ajax.Request(url,{method: 'post' ,onSuccess : function(response){
			    ajaxSubmitException(response.responseText);
				AlarmConfirm('${key.tipsByDeleteConfirm}',"rectificateMain","deleteRecord");
			}});

		}
   }
	function deleteRecord(){
		var url="${ctx}/occupation_joinHandleAction.do?method=deltePerfectItemRequistion";
		var parameter = "index="+index;
		var myAjax = new Ajax.Request(
	                   url,
	                   {method: 'post', parameters:parameter , onComplete: showResponseDelete}
	                   );
	}
	function showResponseDelete(transport){
		ajaxSubmitException(transport.responseText);
		if(transport.responseText=="false"){
			FailureAlert('${key.doFalse}');
		}else{
			reloadRectificateList();
		}
	}
	function reloadRectificateList(){
	    index = null;
		$('rectificateList').src="${ctx}/occupation_joinHandleAction.do?method=initRectificateListCache&id=${inspecteRequisteId }";
	}
</script>
</head>
<body>
	<table width="100%" border="0" cellpadding="0" cellspacing="1">
          <tr>
            <td>
			<div>
			  <table width="100%" border="0" cellpadding="0" cellspacing="0"   class="tab_line">
			    <tr>
			      <td class="bg_toolBar"><table width="100%" border="0" cellspacing="0" cellpadding="0">
			        <tr>
			          <td width="35%">&nbsp;</td>
			          <td width="65%" align="right"><!--------------------------右边图标01----------------------------------->
			                <table width="100%" border="0" cellspacing="0" cellpadding="0">
					        <tr>
					          <td align="right">
							  <table border="0" cellpadding="0" cellspacing="0" id="ico01">
					          <tr>
								 <td class="toolbarico"><a href="#"  onClick="openRectificateAdd();return false;" onFocus="this.blur()"><img src="${ctx}/images/ico_newfile.gif" border="0" align="absbottom" alt="新建" /></a></td>
					    		 <td class="toolbarico"><a href="#"  onClick="openRectificateEdit();return false" onFocus="this.blur()"><img src="${ctx}/images/ico_amend.gif" border="0" align="absbottom" alt="修改" /></a></td>
					             <td class="toolbarico"><a href="#" onClick="showRectificate();return false" onFocus="this.blur()"><img src="${ctx}/images/ico_delete.gif" alt="删 除" width="16" height="16" border="0" align="absbottom" /></a></td>
					             <td  class="toolbarico">&nbsp;</a></td>
					          </tr>
							  </table>
							  </td>
							 </tr>
					        </table>
			         </td>
			        </tr>
			       </table>
			       </td>
			    </tr>
			    <tr>
			      <td valign="top">
			      	<iframe src="${ctx}/occupation_joinHandleAction.do?method=initRectificateListCache&id=${inspecteRequisteId }" name="rectificateList" id="rectificateList" width="100%" height="200px" frameborder="0" scrolling="auto"> </iframe>
			      </td>
			    </tr>
			  </table>
			</div>
			</td>
            </tr>
       </table>
</body>
</html>